import Vue from 'vue'
import UiNotice from './UiNotice'
function Notice(msg, type) {
  const Instance = Vue.extend({
    components: { UiNotice },
    render(h) {
      return h('UiNotice', {
        props: {
          msg: msg,
          type: type
        }
      })
    }
  })
  document.body.appendChild(new Instance().$mount().$el)
  return Instance
}
export default {
  info(text) {
    Notice(text, 'info')
  },
  error(text) {
    Notice(text, 'error')
  },
  success(text) {
    Notice(text, 'success')
  },
  warning(text) {
    Notice(text, 'warning')
  }
}
